<?php   
class ControllerCommonHeader extends Controller {	
	protected function index() {
		$this->data['title'] = $this->document->getTitle();		
		
		$this->load->language('common/header');
		
		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
			$this->data['base'] = HTTPS_SERVER;
		} else {
			$this->data['base'] = HTTP_SERVER;
		}
		
			$this->data['description'] = $this->document->getDescription();
			$this->data['keywords'] = $this->document->getKeywords();
			$this->data['links'] = $this->document->getLinks();	
			$this->data['styles'] = $this->document->getStyles();
			$this->data['scripts'] = $this->document->getScripts();
			$this->data['lang'] = $this->language->get('code');
			$this->data['direction'] = $this->language->get('direction');	
			
			
		if (!$this->user->isLogged() || !isset($this->request->get['token']) || !isset($this->session->data['token']) || ($this->request->get['token'] != $this->session->data['token'])) {
			$this->data['logged'] = '';			
			$this->data['home'] = $this->url->link('common/login', '', 'SSL');
		} else {
			
			// Categories - Language
			$this->data['text_home']=$this->language->get('text_home');
			$this->data['heading_title'] = $this->language->get('heading_title');
			$this->data['logged'] = 'avc';	
			$this->data['text_logout'] = $this->language->get('text_logout');
			$this->data['text_system'] = $this->language->get('text_system');
			$this->data['text_module'] = $this->language->get('text_module');
			$this->data['text_front'] = $this->language->get('text_front');
			$this->data['text_confirm'] = $this->language->get('text_confirm');
			$this->data['text_select_all'] = $this->language->get('text_select_all');
			$this->data['text_unselect_all'] = $this->language->get('text_unselect_all');
			
			$this->data['home'] = $this->url->link('common/home','&token='.$this->session->data['token'],'SSL');
			$this->data['office'] = HTTP_CATALOG;
			$this->data['logout'] = $this->url->link('common/logout','','SSL');
			
			
		}
		$this->template = 'template/common/header.tpl';		
			
		$this->render();
	} 	
}
?>